<style scoped>
.content .w980 {
    padding-top: 0;
}

.nav-path {
    position: relative;
}

.nav-path ol {
    width: 100%;
    height: 36px;
}

.nav-path button.add-hsp-btn {
    position: absolute;
    top: 0;
    right: 0;
}

.nav-path ol li a {
    color: #444;
}

.nav-path ol li:last-child {
    color: #00CB8F;
}


/*机构列表*/

.list-tips {
    padding: 0;
    height: 36px;
    line-height: 36px;
    background: #F5F5F4 url(../../assets/img/list_tips.png) no-repeat 20px center;
    background-size: 4px 20px;
}

.list-tips span {
    float: left;
    font-size: 16px;
    height: 36px;
    line-height: 36px;
    margin-left: 36px;
    text-align: left;
}

.list-tips span.default-span {
    color: #6C6C6C;
    font-size: 14px;
    padding: 0 15px;
    cursor: pointer;
}

.list-tips span.active-span {
    color: #fff;
    background-color: #00C484;
}

.list-tips button.close span {
    font-size: 18px;
    margin: 2px 10px 0 0;
    text-align: left;
}

.org-list .list-tips button {
    float: right;
    width: 118px;
    height: 36px;
    text-align: center;
    color: #fff;
    border-radius: 16px;
    background-color: #1dc499;
    font-size: 16px;
    line-height: 36px;
    margin-right: 20px;
    /*margin-top: calc(50%-0.18rem);*/
    outline: none;
}

.org-list .list-opera .form-inline label {
    margin: 0 10px 0 23px;
    font-size: 12px;
    color: #666460;
    font-weight: 400;
}

.org-list .list-opera .form-inline button {
    width: 98px;
    height: 32px;
    display: inline-block;
    border-radius: 16px;
}

.list-opera {
    margin: 10px 0 20px 0;
}

.list-opera .form-inline .clear-research {
    margin-left: 15px;
    height: 32px;
}

.list-content table th {
    text-align: center;
    line-height: 36px;
    height: 36px;
    font-weight: normal;
    background-color: #F8F8F7;
}

.list-content table tr:nth-child(odd) {
    background-color: #fff;
}

.list-content table tr:nth-child(even) {
    background-color: #F6FBF8;
}

.list-content table td {
    line-height: 40px;
    text-align: center;
    color: #898989;
}

.list-content table tr td:nth-child(1) {
    color: #333
}

.list-content table tr td:nth-child(2),
.list-content table tr td:nth-child(3) {
    color: #333
}

.list-content table tr td a.glyphicon {
    display: inline-block;
    padding: 0 0 0 20px;
    height: 16px;
    font-size: 12px;
    text-align: right;
    margin-right: 5px;
    text-decoration: none;
    color: #444;
    background-repeat: no-repeat!important;
    background-position: left center!important;
}

.list-content table tr td a:first-child {
    background: url(../../assets/img/edit.png);
    background-size: 14px;
}

.list-content table tr td .glyphicon:hover {
    color: #1dc499;
    cursor: pointer;
}

.list-content table tr td a:nth-child(1) {
    background: url(../../assets/img/watch.png);
    background-size: 17px 12px;
}

.list-content table tr td a:nth-child(2) {
    background: url(../../assets/img/nav.png);
    background-size: 16px;
}

.list-content table tr td a:nth-child(3) {
    background: url(../../assets/img/account.png);
    background-size: 16px;
}

.list-content table tr td a:nth-child(4) {
    background: url(../../assets/img/report-exp.png);
    background-size: 13px 16px;
}

.list-content table tr td a:nth-child(5) {
    background: url(../../assets/img/QR_code.png);
    background-size: 14px;
}

.list-content table tr td a:nth-child(6) {
    background: url(../../assets/img/dele4.png);
    background-size: 14px;
}


/*模态框基本设置*/

.modal-dialog .breadcrumb {
    margin-bottom: 0;
}

#add-org-cover .modal-body {
    height: 500px;
    overflow: auto;
    padding: 0 15px;
}


/*模态框*/

.modal-dialog {
    width: 70%;
    height: 600px;
    border-top: 0;
}

.modal-body .form-group {
    display: block;
    margin-bottom: 18px;
    margin-top: 18px;
}

.modal-body .increase-team-per select,
.modal-body .increase-team-per input {
    width: 60%;
    display: inline-block;
}

.modal-body .form-group-foot {
    text-align: center;
}

.modal-body .form-group label {
    width: 27%;
    text-align: right;
}

.modal-body .form-inline .form-control {
    width: 48%;
    text-align: left;
    text-indent: 10px;
    margin-left: 30px;
}


/*hospital Map*/

.modal-body .form-inline .list-top-title {
    vertical-align: top;
}

.modal-body .form-inline .hospital-map {
    width: 48%;
    height: 300px;
    overflow: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: inline-block;
    text-align: left;
    text-indent: 10px;
    margin-left: 30px;
}

.modal-body .form-inline .form-group .file-continer {
    height: 50px;
    background: #fff;
}

.modal-body .form-inline img {
    width: 80px;
    height: 80px;
    float: left;
    border: 0;
    text-indent: 0;
    border-radius: 10% 5%;
}

.modal-body .form-group .sim-explain-textarea {
    width: 48%;
    min-height: 122px;
    margin-left: 30px;
    overflow: auto;
    overflow-x: hidden;
    resize: none;
}

.modal-body .list-tips .team-label {
    float: left;
    height: 36px;
    line-height: 36px;
}

.modal-body .list-tips .new-per {
    float: right;
    height: 36px;
    line-height: 36px;
    color: #1AA9FD;
    margin-right: 46px;
    background: none;
}


/*信息填写不完整提示框*/

.msg-without-complete .modal-dialog {
    width: 100%;
    height: 100%;
}

.msg-without-complete .modal-content {
    width: 50%;
    text-align: center;
    font-size: 16px;
    color: #37B06C;
    line-height: 100px;
    margin: 0 auto;
    top: 50%;
    -left: 50%;
    margin-top: -50px;
}


/*删除提示*/

#delCoverTips .modal-dialog .modal-content {
    width: 90%;
    margin: 0 auto;
}

.del-tips {
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 20px;
}

.del-tips span {
    color: #f00;
    padding: 0 3px;
}

.modal-footer {
    text-align: center;
}

.modal-footer .form-group.clear-margin-bot {
    margin-bottom: 0;
}

.modal-footer .btn {
    outline: none;
}

.modal-footer .btn.btn-primary {
    background-color: #00C782;
}

.modal-footer .btn-opera .form-group {
    text-align: center;
}


/*编辑服务项目*/

.form-group {
    display: block;
    margin-bottom: 18px;
}

.form-group label {
    text-align: right;
}

.exp-mark {
    color: red;
    height: 100%;
    line-height: 100%;
    font-size: 14px;
    margin-right: 5px;
    display: inline-block;
}

.form-group button {
    width: 136px;
    height: 36px;
    color: #FFF;
}

span.error {
    color: #f00;
}


/*查看机构*/

.check-org .check-detail .form-group {
    display: block;
    margin-bottom: 18px;
}

.check-org .check-detail .form-group label {
    width: 154px;
    font-size: 12px;
    color: #6A6966;
    margin-right: 13px;
}

.check-org .check-detail .form-group input {
    width: 478px;
    height: 30px;
    line-height: 30px;
}

.check-org .check-detail .form-group textarea {
    width: 478px;
    padding: 10px;
    height: 122px;
    overflow: auto;
    resize: none;
}

.check-org .check-detail .form-group select {
    width: 478px;
    appearance: none;
    -moz-appearance: none;
    /*?Firefox?*/
    -webkit-appearance: none;
    /*?Safari?和?Chrome?*/
    background: url(../../assets/img/select_bg.png) no-repeat 95% center;
    background-size: 11px 6px;
}

.upload-img {
    width: 80px;
    height: 80px;
    border: 0;
    display: inline-block;
}


/*上传图像按钮*/

.file-continer {
    display: inline-block;
    border: 0;
    width: 45%;
    height: 88px;
    padding: 0;
    position: relative;
    text-align: left;
    margin-left: 30px;
    background: url(../../assets/img/upload_img.png) no-repeat left center;
    background-size: 80px;
}

.reupload-img-btn {
    width: 100px;
    height: 30px;
    line-height: 30px;
    position: relative;
    left: 100px;
    top: 50%;
    margin-top: -15px;
    cursor: pointer;
}

.reupload-img-btn span,
.reupload-img-btn input {
    width: 100px;
    height: 30px;
    float: left;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
}

.reupload-img-btn span {
    background: #00C484;
    font-size: 16px;
    line-height: 30px;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    text-align: center;
}

.reupload-img-btn input {
    opacity: 0;
    filter: alpha(opacity=0);
    z-index: 100;
}


/*信息填写不完整提示框*/

.msg-without-complete {
    -z-index: 10200;
}

.msg-without-complete .modal-content {
    width: 50%;
    text-align: center;
    font-size: 16px;
    color: orangered;
    line-height: 100px;
    margin: 0 auto;
    top: 50%;
    -left: 50%;
    margin-top: -50px;
}


/*所在地区*/

#area-provice,
#area-city {
    width: 22%;
}

.area-lists {
    position: relative;
}

.area-lists .area-load {
    position: absolute;
    top: 30px;
    left: 30%;
    width: 45%;
    height: 300px;
    background: pink;
    overflow: auto;
    z-index: 100;
    border-radius: 10px;
}

.area-lists .area-load ul li {
    width: 100%;
    height: 30px;
    line-height: 30px;
    font-size: 16px;
    text-align: center;
}

.area-lists .area-load ul li a span {
    font-size: 16px;
}

#tree_3 {
    width: 45%;
    left: 30%;
    height: 211px;
    overflow: auto;
}

.j-close-tree {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 16px;
    display: inline-block;
    line-height: 30px;
    cursor: pointer;
    font-size: 20px;
}


/*模态提示*/

#delCoverTips .modal-dialog {
    width: 48%;
    margin: 0 auto;
}


/*删除服务提示*/

.del-tips {
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 20px;
}

.del-tips span {
    color: #f00;
    padding: 0 3px;
}

.start {
    font-size: 14px;
    color: red
}

.imgmodal {
    padding-left: 50%;
    margin-left: -200px;
    height: 250px;
    overflow: hidden;
}

.img-tips {
    position: absolute;
    right: 0;
    top: 20%;
    font-size: 14px;
}
</style>
<template>
    <div class="index clearafter">
        <!-- 头部组件 -->
        <header-component></header-component>
        <div class="content cbafter">
            <!-- 侧部导航组件 -->
            <div class="w220 fl">
                <aside-component></aside-component>
            </div>
            <!-- 右部内容区 -->
            <div class="w980 fr">
                <!-- 路径导航 -->
                <nav class="nav-path">
                    <ol class="breadcrumb">
                        <li><a href="./organizationManage.html">机构管理</a></li>
                        <li>医院报告说明</li>
                    </ol>
                </nav>
                <!-- 1-机构管理列表 -->
                <div class="org-list server-list">
                    <div class="list-tips breadcrumb">
                        <span>报告说明</span>
                        <button onClick="javascript:history.back(-1);">返 回</button>
                        <button @click="addOrgNavigationEvent"> + 添加报告说明</button>
                    </div>
                    <!-- 服务列表内容 -->
                    <div class="list-content">
                        <table class="table table-striped">
                            <table class="table table-hover">
                                <thead>
                                    <tr>
                                        <th class="col-md-2">报告大类</th>
                                        <th class="col-md-3">报告类型</th>
                                        <th class="col-md-3">说明标题</th>
                                        <th class="col-md-4">操 作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr v-for="lists in serverData">
                                        <!--   <td>{{lists.id}}</td> -->
                                        <td>{{lists.reportCatalogText}} </td>
                                        <td>{{lists.reportTypeText}}</td>
                                        <td>{{lists.instructionTitle}}</td>
                                        <td>
                                            <a class="glyphicon" @click="watchAndEditEvent(lists)">查看</a>
                                            <a class="glyphicon" @click="deleteOrgReportEvent(lists)">删除</a>
                                        </td>
                                    </tr>
                                    <tr class="no-data" v-if="isData">
                                        <td colspan="4">暂无查询记录</td>
                                    </tr>
                                </tbody>
                            </table>
                        </table>
                    </div>
                    <!-- 分页 -->
                    <bootpage-component v-ref:page :async="true" :lens="lenArr" :page-len="pageLen" :param="param" :headersparam="headersparam" v-if="isOpenFooterPage"></bootpage-component>
                </div>
                <!--2-添加医院导航 -->
                <div class="check-org">
                    <div id="add-nav-cover" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <div class="list-tips breadcrumb">
                                        <span class="default-span">{{navTips}}</span>
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                            <span aria-hidden="true">&times;</span></button>
                                    </div>
                                </div>
                                <div class="modal-body cbafter">
                                    <!-- 添加机构表单内容 -->
                                    <form class="form-inline" id="add-hsp-org-form" action="#" enctype="multipart/form-data">
                                        <input type="hidden" name="orgId" value="{{param.orgId}}" v-model="param.orgId" id="orgId" />
                                        <div class="form-group">
                                            <label for="exampleInputName2">报告大类型:</label>
                                            <select class="form-control roles-type" v-model="addHspNav.reportCatalog">
                                                <option v-for="item in dictionary.bigType" value="{{item.key}}">{{item.text}}</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2">报告类型:</label>
                                            <select class="form-control roles-type" v-model="addHspNav.reportType">
                                                <option v-for="item in dictionary.type" value="{{item.key}}">{{item.text}}</option>
                                            </select>
                                        </div>
                                        <div class="form-group">
                                        <label for="exampleInputName2">说明标题:<span class="start">*</span></label>
                                            <input name="instructionTitle" type="text" class="form-control" id="shortName" placeholder="请输入说明标题" value="{{addHspNav.instructionTitle}}" v-model="addHspNav.instructionTitle" />
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2" class="list-top-title">备注说明:</label>
                                            <textarea name="remark" value="{{addHspNav.remark}}" v-model="addHspNav.remark" class="form-control sim-explain-textarea" placeholder="请输入备注说明"></textarea>
                                        </div>
                                        <div class="form-group">
                                            <label for="exampleInputName2" class="list-top-title">说明图片:</label>
                                            <div class="file-continer form-control">
                                                <imgid-btn :imgurl="imgurl"></imgid-btn>
                                                <span class="img-tips">建议图片尺寸700×600(px)</span>
                                            </div>
                                        </div>
                                    </form>
                                    <div class="modal-footer">
                                        <div class="btn-opera">
                                            <div class="form-group form-group-foot">
                                                <button type="button" class="btn btn-default save-btn" @click.stop.prevent="confirmAddHspEvent">保 存</button>
                                                <button class="btn btn-default cancel-btn" @click.stop.prevent="cancelAddHspEvent">取 消</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- /.modal-content -->
                        </div>
                        <!-- /.modal-dialog -->
                    </div>
                    <!-- /.modal -->
                </div>
                <!-- 信息填写不完整 -->
                <div class="modal fade msg-without-complete" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
                    <div class="modal-dialog modal-sm" role="document">
                        <div class="modal-content">
                            {{subErrorMsg}}
                        </div>
                    </div>
                </div>
                <!--msg-not-complete-->
                <!-- 删除提示 -->
                <div id="delCoverTips" class="modal fade" tabindex="-1" role="dialog">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                <h4 class="modal-title">报告删除</h4>
                            </div>
                            <div class="modal-body">
                                <p class="del-tips">您确定要删除此"<span v-text="delNavName"></span>"吗？</p>
                            </div>
                            <div class="modal-footer">
                                <div class="form-group">
                                    <button type="button" class="btn btn-default save-btn" @click.stop.prevent="confirmDeleteOrg">确认</button>
                                    <button type="button" class="btn btn-default cancel-btn" data-dismiss="modal">取消</button>
                                </div>
                            </div>
                        </div>
                        <!-- /.modal-content -->
                    </div>
                    <!-- /.modal-dialog -->
                </div>
                <!-- /.modal -->
            </div>
            <!-- 内容区 -->
        </div>
    </div>
</template>
<script>
import 'assets/reset.css';
import 'assets/lib/bootstrap-3.3.2/css/bootstrap.min.css';
import 'assets/lib/bootstrap-3.3.2/js/bootstrap.min.js';

import Header from 'components/module-head.vue';
import Asider from 'components/menu-list.vue';
import footerPage from 'components/BootPage.vue';
import ImgUploadBtn from 'components/ImgUploadBtn.vue'
import Public from 'assets/public.js'

export default {
    data() {
            return {
                headersparam: {
                    'X-Service-Id': 'base.sysOrganizationService',
                    'X-Service-Method': 'queryReportGuide'
                },
                param: {
                    nodeId: '',
                    pageNo: 1,
                    pageSize: 10
                },

                //字典请求数据
                dictionary: {
                    bigType: {}, //报告大类型base_reportType
                    type: {}, //报告类型base_inspectionReportType
                },

                //是否有记录
                isData: false,

                //导航标题
                navTips: '',

                //是否开启分页组件
                isOpenFooterPage: false,
                //信息填写不完整--删除失败
                subErrorMsg: '',
                //图片地址(上传预览)
                defaultUploadImg: '',
                uploadTips: '重新上传',
                serverData: {},
                //添加--机构相关信息(校验)
                addHspNav: {
                    orgId: "",
                    reportType: "002", //报告类型,字典:base_inspectionReportType
                    remark: "",
                    instructionTitle: "",
                    reportCatalog: "1", //报告大类,字典:base_reportType
                    instructionPicture: 0 //说明图片,图片id
                },
                //要删除的导航名称
                delNavName: '',
                delOrgId: '',
                //是否可以编辑导航
                disabledIsShow: 'disabled',
                //编辑？保存？
                nowEditShow: true,
                nowSaveShow: false,
                //新增？保存？区分
                isAddOrEdit: false,
                instructionPicture: '',

                //是否有记录
                isData: false,
                imgurl: "",
            }
        },
        events: {
            'data': function(datas) {
                this.serverData = datas;
            },
            'serviceIconId': function(imgId) {
                this.addHspNav.instructionPicture = imgId;
            }
        },
        watch: {
            'serverData': 'isWatchServerData'
        },
        ready() {
            const orgIds = location.search.split('?')[1].split("=")[1];
            this.param.nodeId = orgIds;
            this.addHspNav.orgId = orgIds;
            this.isOpenFooterPage = true;
            //字典请求
            this.dictionaryRequest();
        },
        components: {
            //头部组件
            'header-component': Header,
            //侧部导航组件
            'aside-component': Asider,
            'bootpage-component': footerPage,
            'imgid-btn': ImgUploadBtn
        },
        methods: {
            //监听数据变化显示是否有记录
            isWatchServerData() {
                    if (this.serverData.length == '' || this.serverData.length == null || this.serverData.length == 'undefined') {
                        this.isData = true;
                    } else {
                        this.isData = false;
                    };
                },

                //字典请求
                dictionaryRequest() {
                    var that = this;
                    var arr = ["base.dictionary.base_reportType", "base.dictionary.base_inspectionReportType"];
                    $.when(Public.commonajax('coms.multipleDictionaryService', 'findDic', '[' + JSON.stringify(arr) + ']')).done(function(res) {
                        $.each(res.body, function(index, ele) {
                            if (ele.dicId == arr[0]) {
                                that.dictionary.bigType = ele.items;
                            }
                            if (ele.dicId == arr[1]) {
                                that.dictionary.type = ele.items;
                            }
                        });
                    });
                },

                //添加医院导航
                addOrgNavigationEvent() {
                    this.disabledIsShow = false;
                    this.navTips = '添加报告';
                    $('#add-nav-cover').modal('show');
                    let newAddData = {
                        'orgId': this.param.nodeId,
                        'reportType': "002",
                        'remark': "",
                        'instructionTitle': "",
                        'reportCatalog': "1", 
                        'instructionPicture': 0
                    };
                    this.addHspNav = newAddData;
                   
                    this.imgurl = "";
                    this.$broadcast("imgurl", this.imgurl);
                    // $('.none').hide();
                },

                //确认--添加导航
                confirmAddHspEvent() {
                    var that = this;
                    //校验--数据
                    var flag = this.validationForm();
                    //请求--判断
                    console.log(this.addHspNav);
                    if (flag == true) {
                        $.when(Public.commonajax('base.sysOrganizationService', 'saveOrgReportGuide', '[' + JSON.stringify(this.addHspNav) + ']')).done(function(res) {
                            //res = this.isAddOrEdit ? JSON.parse(res) : res;
                            if (res.code == 200) {
                                $('#add-nav-cover').modal('hide');
                                Public.ajaxPrompt("保存成功！")
                                    // that.subErrorMsg = '保存成功！';
                                    // $('.msg-without-complete').modal('show');
                                    //  setTimeout(function(){
                                    //   $('.msg-without-complete').modal('hide');
                                    // },1000);
                                that.$refs.page.refresh();
                            } else {
                                Public.ajaxPrompt(res.msg)
                                    // that.subErrorMsg = '操作失败，请联系管理员！';
                                    // $('.msg-without-complete').modal('show');
                                    // setTimeout(function(){
                                    //   $('.msg-without-complete').modal('hide');
                                    //   $('#add-nav-cover').modal('hide');
                                    // },1500);
                            }
                        })
                    } else {
                        this.disabledIsShow = false;
                        this.nowEditShow = false;
                        this.nowSaveShow = true;
                        setTimeout(function() {
                            $('.msg-without-complete').modal('hide');
                            $('#add-nav-cover').modal('show');
                            $('#add-nav-cover').css({
                                'overflow-y': 'scroll'
                            });
                        }, 1500);

                    };
                },

                //取消--添加导航
                cancelAddHspEvent() {
                    $('#add-nav-cover').modal('hide');
                },

                //查看--编辑医院导航（医院）
                watchAndEditEvent(lists) {
                    //机构标题
                    this.navTips = '查看报告说明详情';
                    this.nowEditShow = true;
                    this.nowSaveShow = false;
                    $('#add-nav-cover').modal('show');
                    //已有数据展示
                    //this.addHspNav = lists;
                    this.disabledIsShow = 'disabled';
                    $('#add-nav-cover').modal('show');
                    //区分-新增？编辑
                    this.isAddOrEdit = true;
                    this.instructionPicture = lists.instructionPicture;
                    var that = this;
                    $.when(Public.commonajax('base.sysOrganizationService', 'getReportGuide', '[' + lists.id + ']')).done(function(resss) {
                        that.addHspNav = resss.body;
                        if (resss.body.instructionPicture) {
                            that.imgurl = Public.IMGVIEW_URL() + resss.body.instructionPicture
                        } else {
                            that.imgurl = "";
                            that.$broadcast("imgurl", that.imgurl);
                        }

                        // $('.none').css('display','block');
                        // $('.none').attr('src',Public.IMGVIEW_URL()+resss.body.instructionPicture);
                    });
                },

                //查看--编辑医院导航--编辑(可编辑状态)
                editHspMsgEvent() {
                    //机构标题
                    this.navTips = '编辑报告';
                    this.disabledIsShow = false;
                    this.nowEditShow = false;
                    this.nowSaveShow = true;
                    //清空图像
                    //this.defaultUploadImg = '';
                },

                //查看--编辑医院导航--保存
                confirmSaveHspMsgEvent() {
                    this.defaultUploadImg = '' ? $('.my-files').val('') : $('.my-files').val();
                    $('#add-nav-cover').modal('hide');
                    this.disabledIsShow = 'disabled';
                    this.nowEditShow = true;
                    this.nowSaveShow = false;
                    this.confirmAddHspEvent();
                },

                //查看--编辑医院导航--取消
                cancelEditHspEvent() {
                    this.disabledIsShow = 'disabled';
                    this.nowEditShow = true;
                    this.nowSaveShow = false;
                    $('#add-nav-cover').modal('hide');
                },

                //删除报告说明
                deleteOrgReportEvent(lists) {
                    this.delNavName = lists.instructionTitle;
                    this.delOrgId = lists.id;
                    $('#delCoverTips').modal('show');
                },

                //确认--删除导航
                confirmDeleteOrg() {
                    var that = this;
                    $.when(Public.commonajax('base.sysOrganizationService', 'deleteReportGuide', '[' + this.delOrgId + ']')).done(function(res) {
                        if (res.code == 200) {
                            that.$refs.page.refresh();
                            $('#delCoverTips').modal('hide');
                        } else {
                            that.subErrorMsg = '删除失败，请联系管理员！';
                            $('#delCoverTips').modal('show');
                        };
                    });
                    setTimeout(function() {
                        $('#delCoverTips').modal('hide');
                    }, 1000);
                },

                //图像预览
                imgSayPrevious(event) {
                    var that = this;
                    this.uploadTips = '重新上传';
                    var img = $('.imgpres');
                    var ipt = $('.my-files');
                    var file = event.target.files[0];
                    var reader = new FileReader();
                    reader.readAsDataURL(file);
                    reader.onload = function(event) {
                        that.defaultUploadImg = event.target.result;
                    };
                },

                //表单验证    
                validationForm() {
                    var shortName = $("#shortName").val();
                    if (shortName == '' || shortName == undefined) {
                        this.subErrorMsg = '标题未填写！';
                        $('.msg-without-complete').modal('show');
                        return false;
                    }
                    /*if(this.defaultUploadImg == ""){
                                this.subErrorMsg = '请选择一张图片！';
                                $('.msg-without-complete').modal('show');
                                return false;
                              }*/
                    //$('.msg-without-complete').modal('hide');
                    return true;
                }
        } //methods
}
</script>
